home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1996 #6 / Amiga Plus CD - 1996 - No. 06.iso / pd / netz / amftp / install_amftp < prev    next >
Text File  |  1996-03-05  |  16KB  |  382 lines

  1. ;******************************************************************************
  2. ;      ____           ______ ______ ______
  3. ;     / __ \         / ____//_  __// __  /
  4. ;    / /_/ /_   _   / /_     / /  / /_/ /
  5. ;   / __  // \_/ \ / __/    / /  / ____/
  6. ;  / / / // /__/ // /      / /  / /
  7. ; /_/ /_//_/  /_//_/      /_/  /_/
  8. ;
  9. ; $VER: 1.53c (March-05-1996) 
  10. ; Changes, suggestions or problems: rcr@netcom.com
  11. ; AmFTP Installer ©1995,1996 by Robert C. Reiswig 
  12. ;******************************************************************************
  13. ;*** System Stuff ***
  14. (set cpu (database "cpu"))  (set vblank (database "vblank"))
  15. (set graphmem (database "graphics-mem")) (set totmem (database "total-mem"))
  16. (set osver (/ (getversion "LIBS:version.library") 65536))
  17. (if (= vblank "60") ((set blank "NTSC")) ((set blank "PAL")))
  18. (set fastmem (- totmem graphmem))
  19.  
  20. (if (= osver 37) (set workbench "2.0")) (if (= osver 38) (set workbench "2.1"))
  21. (if (= osver 39) (set workbench "3.0")) (if (= osver 40) (set workbench "3.1"))
  22. (if (= osver 41) (set workbench "4.0"))
  23.  
  24. (set cpu (database "cpu"))
  25. (if (= cpu 68000) (set #cpu 0)) (if (= cpu 68010) (set #cpu 1))
  26. (if (= cpu 68020) (set #cpu 2)) (if (= cpu 68030) (set #cpu 3))
  27. (if (= cpu 68040) (set #cpu 4)) 
  28. (if (> (exists ("sys:libs/68060.library")) 0) (set #cpu 5) )
  29.  
  30. (set vernum1 (getversion "AmFTP")) (set ver1 (/ vernum1 65536)) 
  31. (set rev1 (- vernum1 (* ver1 65536) ) ) (set AmFTPver (cat ver1 "." rev1))
  32.  
  33. (if (> (exists ("env:Language")) 0) (set lanfound (getenv "Language")) )
  34. (set lan 0)
  35.  
  36. (if (= "english"    lanfound) (set lan 0))  (if (= "deutsch"    lanfound) (set lan 1))
  37. (if (= "svenska"    lanfound) (set lan 2))  (if (= "suomi"      lanfound) (set lan 3))
  38. (if (= "français"   lanfound) (set lan 4))  (if (= "norsk"      lanfound) (set lan 5))
  39. (if (= "español"    lanfound) (set lan 6))  (if (= "greek"      lanfound) (set lan 7)) 
  40. (if (= "nederlands" lanfound) (set lan 8))  (if (= "italiano"   lanfound) (set lan 9)) 
  41. (if (= "bosanski"   lanfound) (set lan 10)) (if (= "dansk"      lanfound) (set lan 11)) 
  42. (if (= "polski"     lanfound) (set lan 12))
  43.  
  44. (if (> lan 12) (set lan 0))
  45.  
  46. (set #English    "English")  (set #Deutsch    "Deutsch")
  47. (set #Français   "Français") (set #Español    "Español")
  48. (set #Svenska    "Svenska")  (set #Nederlands "Nederlands")
  49. (set #Norsk      "Norsk")    (set #Suomi "Suomi")
  50. (set #Greek      "Greek")    (set #Italiano "Italiano")
  51. (set #Bosanski   "Bosanski") (set #Dansk "Dansk")
  52. (set #Polski     "Polski")
  53.  
  54.  
  55. (set mfound 0) (set newicon1 1) 
  56. (set keeper 1) (set firsttime 0)
  57.  
  58. ;********************************************************************
  59. ; English Strings
  60. ;********************************************************************
  61. (set #about (cat "\n\n\nWelcome to\n\nAmFTP " AmFTPver "\n\nCopyright © 1995-1996 by Mathias Mischler\n\nAll Rights Reserved.\n") )
  62. (set #nomui (cat "\n\nAmFTP uses Magic User Interface (MUI).\n\nThe installer has not found MUI: to be assigned, "
  63.                  "therefore you AmFTP will not work correctly.  You will need to install "
  64.                  "MUI before running AmFTP."
  65.             )
  66. )
  67. (set #whereAmFTP "Where do you wish to install AmFTP. A directory called 'AmFTP' will be created if one is not there. If a copy of AmFTP is found it will be backed up.")
  68. (set muiver "No Version Installed")
  69. (set #newermui "\n\nAmFTP needs version 3.0 or higher of MUI installed to work correctly.\n\nNow would be a good time to Upgrade!\n\n It looks like you have: \n\n")
  70. (set #need-os "\n\nThe 68020 version of AmFTP needs version 3.0 or higher of the Amiga OS installed to work correctly.\n\n It looks like you have: \n\n")
  71. (set #000used "\n\nThe 68000 version will be installed.") 
  72. (set #filethere1 "\n\nThe installer has found AmFTP version ")
  73. (set #filethere2 " at ")
  74. (set #filethere3 "\n\nThe file will be renamed to ")
  75. (set #filethere4 " and it will then be moved to ")
  76. (set #oktodelete1 "\nIs it ok to delete the older AmFTP binary so that the AmFTP Directory can be made?\n")
  77. (set #oktodelete2 "\nIs it ok to delete the older _renamed_ AmFTP binary so that the AmFTP Directory can be made?\n")
  78. (set #backuptoXXX "Back-UP to file named 'AmFTP")
  79. (set #copyover "Copy Over Old Version")
  80. (set #AmFTPfound "\nThe Installer has found a copy of AmFTP already installed. What do you want to do?\n")
  81. (set #askcpu "\nCPU Check: What CPU does the machine have that you are installing AmFTP on? The installer has found:\n")
  82. (set #no020found "\n\nThe 68020 Version of AmFTP , AmFTP020, was not found in this archive the 68000 version was installed.")
  83. (set #newicon "\nDo you wish to copy over one of the AmFTP Icons from the archive? If you have any ToolTypes already set you should select no.\n")
  84. (set #pickicon "\nAmFTP has a number of different icons you can choose from. Which one would you like to use?\n")
  85. (set #nomultiview (cat "The installer could not find multiview or you are running on a 2.0x Amiga. "
  86.                        "The AmFTP Installer will let you choose between a few different icon to use. "
  87.                        "You can use a picture viewer to look at the 'Icons/ftp_Icons.iff' to see the choices side-by-side, "
  88.                        "or you can just look in the Icon drawer from where you are installing AmFTP from."
  89.                   )
  90. )
  91. (set #nonewicon  "No  - ToolTypes already set.")
  92. (set #yesnewicon "Yes - Copy over Icon.")
  93. (set #whatcat "\nSelect the AmFTP Language catalog you wish to install.\n")
  94. (set #wherecat "\nWhere do you wish to install the AmFTP Language Catalog? Default is ")
  95. (set #catnofind "Can not find this catalog in this AmFTP archive. You may need to get the complete archive from the support site.")
  96. (set #whatdocs "\nWhat AmFTP documentation would you like to install?\n")
  97. (set #wheredocs "Where would you like the AmFTP documentation you selected to be installed?")
  98. (set #byebye (cat "\nAmFTP Install Complete!\n\n" ))
  99. ;********************************************************************
  100. ; Hello
  101. ;********************************************************************
  102. (message #about)
  103. (welcome) 
  104.  
  105. ;********************************************************************
  106. ; MUI installed?
  107. ;********************************************************************
  108. (if (< (exists "mui:") 2)  (message #nomui) )
  109.  
  110. ;********************************************************************
  111. ; Check for AmFTP020 requs
  112. ;********************************************************************
  113. (set ver 0)
  114. (if (exists "mui:mui") 
  115.  (
  116.   (set vernum (getversion "mui:mui") )
  117.   (set ver (/ vernum 65536)) (set rev (- vernum (* ver 65536) ) )
  118.  
  119.   (if (= ver 7) (set muiver "2.0") )   (if (= ver 8) (set muiver "2.1") )
  120.   (if (= ver 9) (set muiver "2.2") )   (if (= ver 10) (set muiver "2.3") )
  121.   (if (= ver 11) (set muiver "3.0") )  (if (= ver 12) (set muiver "3.1") )
  122.   (if (= ver 12) (set muiver "3.2") )
  123.  )
  124. )
  125.  
  126. (if (< ver 11)   ( (message (cat #newermui muiver))   (set cpuPick 0) ))
  127. ;(if (< osver 39) ( (message (cat #need-os workbench #000used)) (set cpuPick 0) ))
  128.  
  129.  
  130. ;********************************************************************
  131. ; Ask where to put AmFTP & Make dir if needed
  132. ;********************************************************************
  133. (set Package (getassign "AmiTCP"))
  134.   (if (= Package "") (set Package (getassign "Inet"))
  135. )
  136.  
  137. (set AmFTPdir  (askdir (prompt #whereAmFTP)
  138.                (help   #whereAmFTP)
  139.                     (default Package)
  140.                )  
  141. )
  142.  
  143. (set where AmFTPdir)
  144.  
  145. (if (= 1 (exists (tackon where "AmFTP") ) ) 
  146.   (
  147.     (set vernum1 (getversion (tackon where "AmFTP") ))
  148.     (set ver1 (/ vernum1 65536)) (set rev1 (- vernum1 (* ver1 65536) ) )
  149.     (set AmFTP_old (cat ver1 "." rev1))
  150.  
  151.     (message (cat #filethere1 ver1 "." rev1 #filethere2 where #filethere3 
  152.                   (cat "AmFTP" AmFTP_old) #filethere4 (tackon AmFTPdir "AmFTP") )
  153.     )
  154.     
  155.  
  156.     (copyfiles (source (tackon where "AmFTP"))
  157.                (dest where) 
  158.                (infos)
  159.                (newname (cat "AmFTP" AmFTP_old))
  160.     )
  161.  
  162.     (delete (tackon AmFTPdir "AmFTP") (prompt #oktodelete1) (help #oktodelete1) (confirm) (infos)) 
  163.  
  164.     (if (< (exists (tackon AmFTPdir "AmFTP")) 2) (makedir (tackon AmFTPdir "AmFTP") (infos)) )    
  165.  
  166.     (copyfiles (source (tackon where (cat "AmFTP" AmFTP_old) ))
  167.                        (dest (tackon AmFTPdir "AmFTP")) 
  168.                        (infos)
  169.                
  170.     )
  171.  
  172.     (delete (tackon where (cat "AmFTP" AmFTP_old)) (prompt #oktodelete2) (help #oktodelete2) (confirm) (infos) ) 
  173.  
  174.     ;(set firsttime 1)
  175.  
  176.   )
  177. )
  178.  
  179. (if (< (exists (tackon AmFTPdir "AmFTP")) 2) (makedir (tackon AmFTPdir "AmFTP") (infos)) )
  180. (set where (tackon AmFTPdir "AmFTP"))
  181. (set @default-dest where)
  182.  
  183. ;********************************************************************
  184. ; Check for old & backup
  185. ;********************************************************************
  186. (if (exists (tackon where "AmFTP")) 
  187.   (
  188.       (set vernum1 (getversion (tackon where "AmFTP") ))
  189.       (set ver1 (/ vernum1 65536)) (set rev1 (- vernum1 (* ver1 65536) ) )
  190.       (set AmFTP_old (cat ver1 "." rev1))
  191.  
  192.       (set keeper  (askchoice (choices  (cat #backuptoXXX AmFTP_old "'")  #copyover)
  193.                      (prompt #AmFTPfound)
  194.                  (help   #AmFTPfound)
  195.                      (default 0)
  196.                )
  197.       )    
  198.  
  199.  
  200.       (if (= keeper 0)
  201.          (copyfiles (source (tackon where "AmFTP"))
  202.                      (dest where) 
  203.                      (infos)
  204.                      (newname (cat "AmFTP" AmFTP_old))
  205.          )
  206.       )          
  207.  
  208.       (set firsttime 1)
  209.     
  210.   )
  211. )
  212.  
  213. ;********************************************************************
  214. ; Double Check on the CPU
  215. ;********************************************************************
  216. (set cpuPick (askchoice (choices "68000" "68010" "68020" "68030"
  217.                          "68040" "68060"
  218.                 )
  219.              (prompt #askcpu)
  220.                      (help   #askcpu)
  221.                    (default #cpu)
  222.       )
  223. )
  224.  
  225. ;********************************************************************
  226. ; Copy over correct AmFTP and Icon if wanted
  227. ;********************************************************************
  228. (if (AND (> cpuPick 1) (exists ("AmFTP020")) )
  229.    (copyfiles (source "AmFTP020") (dest where) (optional "nofail") (newname "AmFTP") )
  230.  
  231.    (copyfiles (source "AmFTP") (dest where) (optional "nofail") )
  232. )
  233.  
  234.  
  235. (if (AND (> cpuPick 1) (= (exists ("AmFTP020")) 0) )
  236.  (message #no020found)
  237. )
  238.  
  239. ;(if (= firsttime 0)  (copyfiles (source "AmFTP.info") (dest where) (optional "nofail") ) )
  240.  
  241. (if (exists ("RegisterAmFTP"))
  242.  (copyfiles (source "RegisterAmFTP") (dest where)  (infos) (optional "nofail") )
  243. )
  244.  
  245.  
  246. (if (OR (= keeper 0) (= firsttime 0))
  247.   (
  248.   
  249.    (set newicon (askchoice (choices #yesnewicon #nonewicon)
  250.                            (prompt #newicon)
  251.                        (help   #newicon)
  252.                            (default 0)
  253.             )
  254.    )
  255.  
  256.    (if (= newicon 0) 
  257.      (
  258.        (if (> (exists ("c:multiview")) 0)  ((set #mpath "c:") (set mfound 1)) )
  259.        (if (> (exists ("sys:Utilities/multiview")) 0) ((set #mpath "sys:Utilities") (set mfound 1)) )
  260.        (if (= mfound 1) (run (cat "run " (tackon #mpath "multiview ") "Icons/ftp_Icons.iff")) )
  261.        (if (<> mfound 1) (message #nomultiview))
  262.  
  263.  
  264.        (set pickicon (askchoice (choices "AmFTP:  World/Disk, 3 Arrows"
  265.                                          "AmFTP2: Amiga w/WorldMap & Sel_Arrow"
  266.                                          "AmFTP3: Amiga w/Earth"
  267.                                 )
  268.                                 (prompt #pickicon)
  269.                                 (help   #pickicon)
  270.                                 (default 0)
  271.             )
  272.        )
  273.  
  274.  
  275.  
  276.      )
  277.    )
  278.  
  279.   
  280.    (if (= pickicon 0) (copyfiles (source "Icons/AmFTP.info") (dest where) (newname "AmFTP.info") (optional "nofail") ))
  281.    (if (= pickicon 1) (copyfiles (source "Icons/AmFTP2.info") (dest where) (newname "AmFTP.info") (optional "nofail") ))
  282.    (if (= pickicon 2) (copyfiles (source "Icons/AmFTP3.info") (dest where) (newname "AmFTP.info") (optional "nofail") ))
  283.  
  284.   )
  285.  
  286. )
  287.  
  288. ;********************************************************************
  289. ; Select and copy over Catalog
  290. ;********************************************************************
  291. (set catalog (askchoice (choices #English #Deutsch #Svenska #Suomi #Français
  292.                                  #Norsk #Español #Greek #Nederlands #Italiano #Bosanski #Dansk #Polski)
  293.                            (prompt #whatcat)
  294.                        (help   #whatcat)
  295.                            (default lan)
  296.              )
  297. )
  298.  
  299.  
  300.  
  301. ;(set #Bosanski   "Bosanski") (set #Dansk "Dansk")
  302. ;(set #Polski     "Polski")
  303.  
  304. (if (= catalog 0)  (set #lcat #English ))   (if (= catalog 1)  (set #lcat #Deutsch))
  305. (if (= catalog 2)  (set #lcat #Svenska))    (if (= catalog 3)  (set #lcat #Suomi))
  306. (if (= catalog 4)  (set #lcat #Français))   (if (= catalog 5)  (set #lcat #Norsk))    
  307. (if (= catalog 6)  (set #lcat #Español))    (if (= catalog 7)  (set #lcat #Greek))
  308. (if (= catalog 8)  (set #lcat #Nederlands)) (if (= catalog 9)  (set #lcat #Italiano))
  309. (if (= catalog 10) (set #lcat #Bosanski))   (if (= catalog 11) (set #lcat #Dansk))
  310. (if (= catalog 12) (set #lcat #Polski)) 
  311.  
  312. (if (<> catalog 0)
  313.  (
  314.   (if (> (exists (cat "Catalogs/" #lcat "/AmFTP.catalog")) 0)
  315.     (
  316.         (set wherecat  (askchoice (choices (tackon where (cat "Catalogs/" #lcat)) (cat "Locale:Catalogs/" #lcat) )
  317.                                   (prompt (cat #wherecat (tackon where (cat "Catalogs/" #lcat)) "\n"))
  318.                             (help   #wherecat)
  319.                                (default 0)
  320.                        )  
  321.         )
  322.  
  323.       (if (= wherecat 1)
  324.         (
  325.          (if (< (exists "Locale:") 2) ( (makedir "sys:Locale") (makeassign "Locale" "sys:Locale") ) )
  326.          (if (< (exists "Locale:Catalogs") 2) (makedir "sys:Locale/Catalogs") )
  327.          (if (< (exists (cat "Locale:Catalogs/" #lcat)) 2) (makedir (cat "sys:Locale/Catalogs/" #lcat)) )
  328.          (copylib (source (cat "Catalogs/" #lcat "/AmFTP.catalog")) (dest (cat "sys:Locale/Catalogs/" #lcat)) )
  329.         )
  330.   
  331.         (
  332.          (if (< (exists (tackon where "Catalogs")) 2) (makedir (tackon where "Catalogs")) )
  333.          (if (< (exists (tackon where (cat "Catalogs/" #lcat)) ) 2) (makedir (tackon where (cat "Catalogs/" #lcat)) ) )
  334.          (copylib (source (cat "Catalogs/" #lcat "/AmFTP.catalog")) (dest (tackon where (cat "Catalogs/" #lcat)) ) (optional "nofail") )
  335.         )
  336.       )
  337.  
  338.     )
  339.  
  340.     (message (cat "\nCatalogs/" #lcat "/AmFTP.catalog\n\n" #catnofind))
  341.   )
  342.  
  343.  
  344.  )
  345. )
  346.  
  347. ;********************************************************************
  348. ; Ask and and copy docs if wanted!
  349. ;********************************************************************
  350. (set docs (askoptions (choices "AmFTP.guide" "AmFTP.doc" "AmFTP.Changes")
  351.               (prompt #whatdocs)
  352.                       (help #whatdocs)
  353.                   (default 3)
  354.       )
  355. )
  356.  
  357. (if (<> docs 0)
  358.  (
  359.    (set docsdir (askdir (prompt #wheredocs)
  360.                (help   #wheredocs)
  361.                     (default where)
  362.                 )  
  363.    )
  364.  
  365.    (if (IN docs 0) (copyfiles (source "AmFTP.guide") (dest docsdir) (infos) (optional "nofail") ) )
  366.    (if (IN docs 1) (copyfiles (source "AmFTP.doc") (dest docsdir) (infos) (optional "nofail") ) )
  367.    (if (IN docs 2) (copyfiles (source "AmFTP.Changes") (dest docsdir) (infos) (optional "nofail") ) )
  368.  
  369.  )
  370. )
  371. ;********************************************************************
  372. ; copy keyfile if there 
  373. ;********************************************************************
  374. (if (> (exists "AmFTP.Key") 0)
  375.  (copyfiles (source "AmFTP.Key") (dest where) (infos) (optional "nofail") ) 
  376. )
  377.  
  378. ;********************************************************************
  379. ; End Bye 
  380. ;********************************************************************
  381. (exit #byebye)
  382.